import { Layout, Menu } from 'antd';
import { useState } from 'react';
import { DashboardFilled, MailFilled, SignalFilled, LockFilled, ChromeFilled, CarryOutFilled, AppstoreFilled, SettingFilled } from '@ant-design/icons';
const {  Sider } = Layout;
function getItem (label, key, icon, children) {
  return {
    key,
    icon,
    children,
    label
  };
}
const items = [
  getItem('首页', '/home', <DashboardFilled />),
  getItem('访客记录', '', <MailFilled />, [
    getItem('访客列表', '/home/visitor'),
    getItem('访客添加修改', '4'),
    getItem('负责人操作导入详细', '5'),
  ]),
  // getItem('部门管理', 'sub2', <SignalFilled />, [
  //   getItem('部门列表', '6'),
  //   getItem('部门添加修改', '8')
  // ]),
  // getItem('管理员', 'sub2', <LockFilled />, [
  //   getItem('管理员列表', '6'),
  //   getItem('管理员添加修改', '8')
  // ]),
  // getItem('核销人员管理', 'sub2', <ChromeFilled />, [
  //   getItem('核销人员列表', '6'),
  //   getItem('核销人员添加修改', '8'),
  //   getItem('核销人员日志', '8')
  // ]),
  // getItem('审核日志', 'sub2', <CarryOutFilled />, [
  //   getItem('审核列表', '6')
  // ]),
  // getItem('校园动态', 'sub2', <AppstoreFilled />, [
  //   getItem('校园动态列表', '6'),
  //   getItem('校园动态添加修改', '6')
  // ]),
  getItem('系统设置', '/home/set', <SettingFilled />),
];
const HomeMenu = () => {
  const [collapsed, setCollapsed] = useState(false);
  return (
    <>
      {/* 左侧菜单 */}
      <Sider collapsible collapsed={collapsed} onCollapse={(value) => setCollapsed(value)}>
        <Menu theme="dark" defaultSelectedKeys={['1']} mode="inline" items={items} />
      </Sider>
    </>
  )
}
export default HomeMenu